package creational.abstractfactory;

public class Pc {
    private ICpu pCpu;
    private IMainboard pMainboard;
    private IGraphicsCard pGraphicsCard;

    public Pc(ICpu pCpu, IMainboard pMainboard, IGraphicsCard pGraphicsCard) {
        this.pCpu = pCpu;
        this.pMainboard = pMainboard;
        this.pGraphicsCard = pGraphicsCard;
    }

    public void run() {
        this.pMainboard.installCpu();
        this.pMainboard.installGC();
        this.pCpu.run();
        this.pGraphicsCard.run();
        System.out.println("\r\n");
    }
}
